<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

    <title>修改密码</title>
 <%@include file="/WEB-INF/jsp/public/commons.jspf"%>
 <script type="text/javascript">
 	function check(){
 		var oldpwd="${session.user.password}";
 		var oldpassword=document.getElementById("oldpassword").value;
 		var password=document.getElementById("password").value;
 		var password2=document.getElementById("password2").value;
 		if(oldpassword != oldpwd){
 			alert("旧密码不正确");
 			return false;
 		}
 		else{
 			if(password==''){
 				alert("密码不能为空，请重新输入！");
 				return false;
 			}
 			else if(password!=password2){
 				alert("两次密码不一致，请重新输入！");
 				return false;
 			}
 			else{
 				return true;
 			}
 		}
 	}
 </script>

  </head>
  
  <body>
 	<form action="personal_updatepassword.action" method="post">
		<table class="col-sm-8 col-sm-offset-1">
			<tr>
				<td class="form-group"><label class="col-sm-3 control-label">旧密码：</label>
					<div class="col-sm-9">
						<input type="password" id="oldpassword" name="oldpassword" class="form-control">
					</div>
				</td>
			</tr>
			<tr><td><br></td></tr>
			<tr>
				<td class="form-group"><label class="col-sm-3 control-label">新密码：</label>
					<div class="col-sm-9">
						<input type="password" id="password" name="password" class="form-control">
					</div>
				</td>
			</tr>
			<tr><td><br></td></tr>
			<tr>
				<td class="form-group"><label class="col-sm-3 control-label">确认密码：</label>
					<div class="col-sm-9">
						<input type="password" id="password2" name="password2" class="form-control">
					</div>
				</td>
			</tr>
			<tr><td><br></td></tr>
			<tr>
				<td class="form-group">
				<div class="col-sm-offset-9 col-sm-2">
					<button type="submit" class="btn btn-default" onclick="return check()">保存修改</button>
				</div>
				</td>
			</tr>
		</table>
	</form>
  </body>

</html>

